GrpClient Methods

The GrpClient object contains the following methods:

Group Blob Naming Rules

File names and file paths as expressed through the Group Blob functions must adhere to the following rules:

Element Naming Rules
File names
  • Must not be empty and can be no more than 40 characters long.
  • Cannot contain the following characters:
    \     <     >     :     "     |     ?     *
  • The final character cannot be a period (".") or a space (" ").
File paths
  • Each segment of the path, delineated by a slash ("\"), must adhere to the rules for file names.
  • The path must begin with a double slash ("\\") and then the SITE.SERVICE for the desired Group service followed by the path, or with a single slash ("\") and then the path.

Both the complete path and the individual names retain their case, but are case-insensitive for searching, adding, and deleting.

AddDirectory

The AddDirectory method creates a new directory at the specified path with the specified name, if the path exists.

Syntax

AddDirectory(nodePath As String, newName as String)

Parameters

Parameter Required Description

nodePath

Yes

A valid Group Blob node path to the node in the form "\\SITE.SERVICE\folder1\folder2" or "\\SITE.SERVICE\folder1\file.txt".

newName

Yes

The name of the directory to create.

See Group Blob Naming Rules above for information about naming rules for file names and file paths.

Remarks

This adds a directory to the path specified. This will only work if the nodePath is valid.

If an invalid path is specified for nodePath, the directory will not be added and no error will be displayed.

Example

The following example adds a folder named "New" to the path specified. It then checks if the folder exists and alerts the user.

Copy
AddDirectory
Sub addDir()
 
    GrpClient.AddDirectory "\\CYGDEMO.GRP\MyFolder", "New"
    edtMessage.Text = GrpClient.DirectoryExists("\\CYGDEMO.GRP\MyFolder\New")
    'Returns True
 
End Sub

Back to top

AddNodeToCache

The AddNodeToCache method adds the Node with the specified ID to the cache.

Syntax

AddNodeToCache(nodeId As String)

Parameters

Parameter Required Description

nodeId

Yes

The ID of the valid GRP Node.

Example

The following example adds the Node with ID 0000000008 to the cache.

Copy
AddNodeToCache
Sub
 
    GrpClient.AddNodeToCache "0000000008"
 
End Sub

Back to top

AttachChild

The AttachChild method attaches the child with the specified ID to the parent with the specified ID.

Syntax

AttachChild(childNodeId As String, parentNodeId As String, GrpSiteService As Variant)

Parameters

Parameter Required Description

childNodeId

Yes

The ID of the child Node to attach to the parent Node.

parentNodeId

Yes

The ID of the parent Node.

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example attaches Node 0000000014 to parent Node 0000000008.

Copy
AttachChild
Sub
 
    GrpClient.AttachChild "0000000014", "0000000008"
 
End Sub

Back to top

CanCreateNodes

The CanCreateNodes method returns true if the user can create nodes in the GRP database.

Syntax

CanCreateNodes(GrpSiteService As Variant) As Boolean

Parameters

Parameter Required Description

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example verifies the user can create Nodes, and creates a Node.

Copy
CanCreateNodes
Sub
 
    Dim bRet
    bRet = GrpClient.CanCreateNodes()
     
    Dim strNodeId
        If bRet Then
        strNodeId = GrpClient.CreateNode("L", "~F", "My leaf Node")
    End If
     
    MsgBox strNodeId
 
End Sub

Back to top

CanDeleteNodes

The CanDeleteNodes method returns true if the user can delete nodes from the GRP database.

Syntax

CanDeleteNodes(GrpSiteService As Variant) As Boolean

Parameters

Parameter Required Description

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example verifies the user can delete Nodes, and deletes a Node.

Copy
CanDeleteNodes
Sub
 
    Dim bRet
    bRet = GrpClient.CanDeleteNodes()
     
    If bRet Then
        GrpClient.DeleteNode "0000000015"
    End If
 
End Sub

Back to top

CanUpdateNodes

The CanUpdateNodes method returns true if the user can update nodes in the GRP database.

Syntax

CanUpdateNodes(GrpSiteService As Variant) As Boolean

Parameters

Parameter Required Description

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example verifies the user can update Nodes, and updates a Node attribute.

Copy
CanUpdateNodes
Sub
 
    Dim bRet
    bRet = GrpClient.CanUpdateNodes()
     
    If bRet Then
        GrpClient.UpdateNodeAttribute "0000000005", "~attryn0", "Yes"
    End If
 
End Sub

Back to top

CheckCacheState

The CheckCacheState method forces an immediate check to see if the service has changed.

Syntax

CheckCacheState(grpService As String)

Parameters

Parameter Required Description

grpService

Yes

The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example evaluates the cache state using the value of the SiteService property from the script’s group client object.

Copy
CheckCacheState
Sub
 
    GrpClient.CheckCacheState GrpClient.SiteService
 
End Sub

Back to top

Connect

The Connect method connects the object to a service.

Syntax

Connect(DomainSiteService As String)

Parameters

Parameter Required Description

DomainSiteService

Yes

The [Domain]Site.Service to which to connect. The domain is optional. The service must be a valid one.

Remarks

Returns 0 if successful and a non-zero value if the connection failed.

Example

The following example connects the Client object to the CYGDEMO.<SVC> on domain 5410:

Copy

Connect

Sub GrpConnect()

    'Connect to a GRP
    Dim GrpClient
    Set GrpClient = CreateObject("CxGrp.GrpClient")
    GrpClient.Connect("[5410]CYGDEMO.GRPS")

End Sub

Back to top

CopyGroupBlob

The CopyGroupBlob method copies a Group Blob node to a specified new Group Blob location.

Syntax

CopyGroupBlob(nodePath As String, newPath As String)

Parameters

Parameter Required Description

nodePath

Yes

A valid Group Blob node path to the node in the form "\\SITE.SERVICE\folder1\folder2" or "\\SITE.SERVICE\folder1\file.txt".

newPath

Yes

The new path for the Node. This must be relative to nodePath, and in the form "\folder1\folder3".

See Group Blob Naming Rules above for information about naming rules for file names and file paths.

Remarks

nodePath must specify a file. Directories cannot be copied.

If an invalid path is specified for nodePath or newPath, a runtime error will be displayed.

Example

The following example copies "Test.txt" from folder "2" to folder "3", and alerts the user that two copies exist.

Copy
CopyGroupBlob
Sub copyBlob()
 
    GrpClient.CopyGroupBlob "\\CYGDEMO.GRP\1\2\Test.txt", "\1\3"
    MsgBox GrpClient.FileExists("\\CYGDEMO.GRP\1\2\Test.txt")  'Returns True
    MsgBox GrpClient.FileExists("\\CYGDEMO.GRP\1\3\Test.txt")  'Returns True
 
End Sub

Back to top

CreateDirectory

The CreateDirectory method creates a directory at the specified path, and all directories above in the full path.

Syntax

CreateDirectory(nodePath As String)

Parameters

Parameter Required Description

nodePath

Yes

A valid Group Blob node path to the node in the form "\\SITE.SERVICE\folder1\folder2" or "\\SITE.SERVICE\folder1\file.txt".

See Group Blob Naming Rules above for information about naming rules for file names and file paths.

Remarks

This method creates a complete directory path. It will create any directory in the path that does not exist already.

If nodePath specifies an invalid path, the directory will not be created and no error will be displayed. If the user tries to create a folder that already exists, a new folder will be created inside the existing one with the same name (ex. \\CYGDEMO.GRP\test already exists. CreateDirectory("\\CYGDEMO.GRP\test") will make \\CYGDEMO.GRP\test\test)

Example

The following example creates a directory.

Copy
CreateDirectory
Sub createDir()
 
    GrpClient.CreateDirectory "\\CYGDEMO.GRP\NewFolder\Test\A"
    edtMessage.Text = GrpClient.DirectoryExists("\\CYGDEMO.GRP\NewFolder\Test\A")
    'Returns  True
 
End Sub

Back to top

CreateNode

The CreateNode method creates a node and returns the new node ID.

Syntax

CreateNode(nodeCat As String, nodeType As String, nodeDesc As String, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

nodeCat

Yes

The ID of the category of the new Node.  See Node Categories for a list of possible values.

nodeType

Yes

The ID of the type of the new Node.  See Node Types for a list of possible values.

nodeDesc

Yes

The description of the Node.

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example verifies the user can create Nodes, and creates a Node.

Copy
CreateNode
Sub
 
    Dim bRet
    bRet = GrpClient.CanCreateNodes()
     
    Dim strNodeId
    If bRet Then
        strNodeId = GrpClient.CreateNode("L", "~F", "My leaf Node")
    End If
     
    MsgBox strNodeId
 
End Sub

Back to top

DeleteNode

The DeleteNode method deletes the specified node.

Syntax

DeleteNode(nodeId As String, GrpSiteService As Variant)

Parameters

Parameter Required Description

nodeId

Yes

The ID of the valid GRP Node.

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example verifies the user can delete Nodes, and deletes a Node.

Copy
DeleteNode
Sub
 
    Dim bRet
    bRet = GrpClient.CanDeleteNodes()
     
    If bRet Then
        GrpClient.DeleteNode "0000000015"
    End If
 
End Sub

Back to top

DetachChild

The DetachChild method detaches the child with the specified ID from the parent with the specified ID.

Syntax

DetachChild(childNodeId As String, parentNodeId As String, GrpSiteService As Variant)

Parameters

Parameter Required Description

childNodeId

Yes

The ID of the child Node to detach from the parent Node.

parentNodeId

Yes

The ID of the parent Node.

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example detaches Node 0000000014 from parent Node 0000000008.

Copy
DetachChild
Sub
 
    GrpClient.DetachChild "0000000014", "0000000008"
 
End Sub

Back to top

DirectoryExists

The DirectoryExists method returns true if the directory at the specified path exists.

Syntax

DirectoryExists(nodePath As String) As Boolean

Parameters

Parameter Required Description

nodePath

Yes

A valid Group Blob node path to the node in the form "\\SITE.SERVICE\folder1\folder2" or "\\SITE.SERVICE\folder1\file.txt".

See Group Blob Naming Rules above for information about naming rules for file names and file paths.

Remarks

If nodePath specifies a file or an invalid path, this method will return False.

Example

The following example alerts the user whether or not "MyFolder" exists.

Copy
DirectoryExists
Sub dirExists()
 
    Dim bExists
    bExists = GrpClient.DirectoryExists("\\CYGDEMO.GRP\MyFolder\")
    If bExists Then
        edtMessage.Text = "MyFolder exists"
    Else
        edtMessage.TExt = "MyFolder does not exist"
    End If
 
End Sub

Back to top

Disconnect

The Disconnect method disconnects from the connected service.

Syntax

Disconnect() As Integer

Remarks

The Disconnect method returns 0 if successful and a non-zero value if the disconnect failed.

Example

The following example disconnects the Client object from the connected service, and pops a message box if it is unsuccessful:

Copy
Disconnect
Sub Svc.Disconnect()
 
    <SvcClient>.Disconnect()
    MsgBox "Service has disconnected."
    
    If <SvcClient>.Disconnect <> 0 
    Then
        MsgBox "Failed to disconnect."
    End If

End Sub

Back to top

FileExists

The FileExists method returns true if the file in the specified path exists.

Syntax

FileExists(nodePath As String) As Boolean

Parameters

Parameter Required Description

nodePath

Yes

A valid Group Blob node path to the node in the form "\\SITE.SERVICE\folder1\folder2" or "\\SITE.SERVICE\folder1\file.txt".

See Group Blob Naming Rules above for information about naming rules for file names and file paths.

Remarks

If nodePath specifies a folder or an invalid path, this method will return False.

Example

The following example alerts the user whether or not "File.txt" exists.

Copy
FileExists
Sub fileExists()
 
    Dim bExists
    bExists = GrpClient.FileExists("\\CYGDEMO.GRP\MyFolder\File.txt")
    If bExists Then
        edtMessage.Text = "File.txt exists"
    Else
        edtMessage.TExt = "File.txt does not exist"
    End If
 
End Sub

Back to top

GetAttributeMetadata

The GetAttributeMetadata retrieves information about the columns in use in the current GRP in the form of an array of IGrpAttributeMetadata objects.

Syntax

GetAttributeMetadata As Array()

Back to top

GetAttrValue

The GetAttrValue method retrieves an attribute value for the specified Node.

Syntax

GetAttrValue(nodeId As String, attrIdAsStringOrEnum As Variant, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

nodeId

Yes

The ID of the valid GRP Node.

attrIdAsStringOrEnum

Yes

The ID of the attribute, as either the attribute’s name or its enumeration.

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example retrieves an attribute value and displays it in a message box.

Copy
GetAttrValue
Sub
 
    Dim strVal
    strVal = GrpClient.GetAttrValue("0000000005", "~attr0")
     
    MsgBox strVal
 
End Sub

Back to top

GetChildren

The GetChildren method retrieves the child node ID list for a specified node.

Syntax

GetChildren(parentNodeId As String, Criteria As String, OrderBy As String, ChildIdList As Variant, GrpSiteService As Variant)

Parameters

Parameter Required Description

parentNodeId

Yes

The ID of the Node for which to retrieve children.

Criteria

Yes

A set of semicolon-separated column/value parameter pairs used to filter the children.  See Node Attributes for a list of possible attribute IDs by which to filter.

OrderBy

Yes

A semicolon-separated list of columns by which to order the list of returned children. See Node Attributes for a list of possible attribute IDs by which to order.

ChildIdList

Yes

The child Node ID list returned by this method.

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example retrieves a filtered child Node list for parent Node 0000000008 and presents it in a message box.

Copy
GetChildren
Sub
 
    Dim aryChildren
    GrpClient.GetChildren "0000000008", "~type=~F;~attr0=ATTR_VAL", "~cat;~appl1", aryChildren
     
    Dim i, strChildren
    For i = 0 To UBound(aryChildren)
    strChildren = strChildren & aryChildren(i) & vbCr
    Next
     
    MsgBox strChildren
 
End Sub

Back to top

GetChildrenRecursive

The GetChildrenRecursive method retrieves the child node ID list recursively for a specified node.

Syntax

GetChildrenRecursive(parentNodeId As String, Criteria As String, OrderBy As String, ChildIdList As Variant, GrpSiteService As Variant)

Parameters

Parameter Required Description

parentNodeId

Yes

The ID of the Node for which to retrieve children recursively.

Criteria

Yes

A set of semicolon-separated column/value parameter pairs used to filter the children.  See Node Attributes for a list of possible attribute IDs by which to filter.

OrderBy

Yes

A semicolon-separated list of columns by which to order the list of returned children. See Node Attributes for a list of possible attribute IDs by which to order.

ChildIdList

Yes

The child Node ID list returned by this method.

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Remarks

This method differs from GetChildren in that it will perform GetChildren on each returned child Node recursively until a leaf Node is reached.

Example

The following example retrieves a filtered child Node list for parent Node 0000000008 and presents it in a message box.

Copy
GetChildrenRecursive
Sub
 
    Dim aryChildren
    GrpClient.GetChildrenRecursive "0000000008", "~type=~F;~attr0=ATTR_VAL", "~cat;~appl1", aryChildren
     
    Dim i, strChildren
    For i = 0 To UBound(aryChildren)
    strChildren = strChildren & aryChildren(i) & vbCr
    Next
     
    MsgBox strChildren
 
End Sub

Back to top

GetDirectoryNodeIdFromGroupBlobPath

The GetDirectoryNodeIdFromGroupBlobPath method returns the current node ID if a directory is specified and it returns the parent directory node ID if a file (leaf) is specified from the specified Blob path.

Syntax

GetDirectoryNodeIdFromGroupBlobPath(nodePath As String, grpService As String) As String

Parameters

Parameter Required Description

nodePath

Yes

A valid Group Blob node path to the node in the form "\\SITE.SERVICE\folder1\folder2" or "\\SITE.SERVICE\folder1\file.txt".

grpService

Yes

The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

See Group Blob Naming Rules above for information about naming rules for file names and file paths.

Remarks

If nodePath specifies a file, this method will return the directory in which the file is located. If nodePath specifies an invalid path, an empty string is returned.

Example

The following example retrieves the Node ID from both a Blob path and a file. In both cases, the return value is the same.

Copy
GetDirectoryNodeIdFromGroupBlobPath
Sub getDirNodeId()
 
    MsgBox GrpClient.GetDirectoryNodeIdFromGroupBlobPath ("\MyFolder\file.txt", "CYGDEMO.GRP")
    'Returns  "0000000080"
     
    MsgBox GrpClient.GetDirectoryNodeIdFromGroupBlobPath ("\MyFolder", "CYGDEMO.GRP")
    'Returns  "0000000080"
 
End Sub

Back to top

GetFileNodeIdFromGroupBlobPath

The GetFileNodeIdFromGroupBlobPath method returns the correct node ID if a file (leaf) node is presented and it returns nothing if a directory is provided.

Syntax

GetFileNodeIdFromGroupBlobPath(nodePath As String, grpService As String) As String

Parameters

Parameter Required Description

nodePath

Yes

A valid Group Blob node path to the node in the form "\\SITE.SERVICE\folder1\folder2" or "\\SITE.SERVICE\folder1\file.txt".

grpService

Yes

The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

See Group Blob Naming Rules above for information about naming rules for file names and file paths.

Remarks

If nodePath specifies a directory or an invalid path, an empty string is returned.

Example

The following example retrieves the Node ID for the specified file.

Copy
GetFileNodeIdFromGroupBlobPath
Sub getFileNodeId()
 
    MsgBox GrpClient.GetFileNodeIdFromGroupBlobPath ("\MyFolder\Test.txt", "CYGDEMO.GRP")
    'Returns  "0000000081"
 
End Sub

Back to top

GetFirstHierarchyLevelNode

The GetFirstHierarchyLevelNode method retrieves the first hierarchy level node for the specified node.

Syntax

GetFirstHierarchyLevelNode(nodeId As String, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

nodeId

Yes

The ID of the valid GRP Node.

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example retrieves the first hierarchy level Node for a specified Node.

Copy
GetFirstHierarchyLevelNode
Sub
 
    Dim strNode
    strNode = GrpClient.GetFirstHierarchyLevelNode("0000000020")
     
    MsgBox strNode
 
End Sub

Back to top

GetGroupBlobPathFromNodeId

The GetGroupBlobPathFromNodeId method retrieves the Group Blob path for a specified Node ID.

Syntax

GetGroupBlobPathFromNodeId(nodeID As String, grpService As String) As String

Parameters

Parameter Required Description

nodeId

Yes

The ID of the valid GRP Node.

grpService

Yes

The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Remarks

This method works for both files and folders.

If NodeID is invalid or refers to a non-existent Node, an empty string is returned.

Example

The following example retrieves the Node path for the Node that has an ID of 0000000080.

Copy
GetGroupBlobPathFromNodeId
Sub getBlobPath()
 
    MsgBox GrpClient.GetGroupBlobPathFromNodeId("0000000080", "CYGDEMO.GRP")
    'Returns  "\MyFolder"
 
End Sub

Back to top

GetHierarchyAsXml

The GetHierarchyAsXml method retrieves a hierarchy in XML format, starting with the specified Node.

Syntax

GetHierarchyAsXml(nodeId As String, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

nodeId

Yes

The ID of the valid GRP Node.

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example Retrieves the hierarchy of a specified Node as an XML string.

Copy
GetHierarchyAsXml
Sub
 
    Dim strXml
    strXml = GrpClient.GetHierarchyAsXml("0000000008")
 
    MsgBox strXml
 
End Sub

Back to top

GetNodeAppDef1

The GetNodeAppDef1 method retrieves the Node App Defined 1 field for a specified node.

Syntax

GetNodeAppDef1(nodeId As String, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

nodeId

Yes

The ID of the valid GRP Node.

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example retrieves the Node App Defined 1 field of a specified Node.

Copy
GetNodeAppDef1
Sub
 
    MsgBox GrpClient.GetNodeAppDef1("0000000008")
 
End Sub

Back to top

GetNodeAppDef2

The GetNodeAppDef2 method retrieves the Node App Defined 2 field for a specified node.

Syntax

GetNodeAppDef2(nodeId As String, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

nodeId

Yes

The ID of the valid GRP Node.

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example retrieves the Node App Defined 2 field of a specified Node.

Copy
GetNodeAppDef2
Sub
 
    MsgBox GrpClient.GetNodeAppDef1("0000000008")
 
End Sub

Back to top

GetNodeAppDef3

The GetNodeAppDef3 method retrieves the Node App Defined 3 field for a specified node.

Syntax

GetNodeAppDef3(nodeId As String, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

nodeId

Yes

The ID of the valid GRP Node.

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example retrieves the Node App Defined 3 field of a specified Node.

Copy
GetNodeAppDef3
Sub
 
    MsgBox GrpClient.GetNodeAppDef3("0000000008")
 
End Sub

Back to top

GetNodeCat

The GetNodeCat method retrieves the Node Category for a specified Node.

Syntax

GetNodeCat(nodeId As String, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

nodeId

Yes

The ID of the valid GRP Node.

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example retrieves the Node Category of a specified Node.

Copy
GetNodeCat
Sub
 
    MsgBox GrpClient.GetNodeCat("0000000008")
 
End Sub

Back to top

GetNodeDesc

The GetNodeDesc method retrieves the Node Description for a specified node.

Syntax

GetNodeDesc(nodeId As String, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

nodeId

Yes

The ID of the valid GRP Node.

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example retrieves the Node Description of a specified Node.

Copy
GetNodeDesc
Sub
 
    MsgBox GrpClient.GetNodeDesc("0000000008")
 
End Sub

Back to top

GetNodeHierRoot

The GetNodeHierRoot method retrieves the Node Hierarchy Root for a specified node.

Syntax

GetNodeHierRoot(nodeId As String, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

nodeId

Yes

The ID of the Node for which to retrieve the Node Hierarchy Root.

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example retrieves the Node Hierarchy Root of a specified Node.

Copy
GetNodeHierRoot
Sub
 
    MsgBox GrpClient.GetNodeHierRoot("0000000008")
 
End Sub

Back to top

GetNodeIdFromGroupBlobPath

The GetNodeIdFromGroupBlobPath method retrieves the node ID for the node in the specified Blob node path.

Syntax

GetNodeIdFromGroupBlobPath(nodePath As String, grpService As Variant) As String

Parameters

Parameter Required Description

nodePath

Yes

A valid Group Blob node path to the node in the form "\\SITE.SERVICE\folder1\folder2" or "\\SITE.SERVICE\folder1\file.txt".

grpService

Yes

The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

See Group Blob Naming Rules above for information about naming rules for file names and file paths.

Example

The following example retrieves the Node Hierarchy Root of a specified Node.

Copy
GetNodeIdFromGroupBlobPath
Sub
 
    MsgBox GrpClient.GetNodeIdFromGroupBlobPath("\1\2\Test.txt", "CYGDEMO.GRP")
 
End Sub

Back to top

GetNodePathList

The GetNodePathList method retrieves the Node path between the specified ancestor and descendant Nodes.

Syntax

GetNodePathList(ancestorNodeId As String, descendantNodeId As String, NodePathList As Variant, GrpSiteService As Variant)

Parameters

Parameter Required Description

ancestorNodeId

Yes

The ID of the starting Node in the path.

descendantNodeId

Yes

The ID of the ending Node in the path.

NodePathList

Yes

The Node path list returned by this method.

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

See Group Blob Naming Rules above for information about naming rules for file names and file paths.

Example

The following example retrieves the Node path between two Nodes and presents it in a message box.

Copy
GetNodePathList
Sub
 
    Dim aryPath
    GrpClient.GetNodePathList "0000000008", "0000000018", aryPath
     
    Dim i, strPath
    For i = 0 To UBound(aryPath)
    strPath = strPath & aryPath(i) & vbCr
    Next
     
    MsgBox strPath
 
End Sub

Back to top

GetNodeRefId

The GetNodeRefId method retrieves the Node Reference ID for a specified node.

Syntax

GetNodeRefId(nodeId As String, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

nodeId

Yes

The ID of the valid GRP Node.

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example retrieves the Node Reference ID of a specified Node.

Copy
GetNodeRefId
Sub
 
    MsgBox GrpClient.GetNodeRefId("0000000008")
 
End Sub

Back to top

GetNodeRefService

The GetNodeRefService method retrieves the Node Reference Service for a specified node.

Syntax

GetNodeRefService(nodeId As String, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

nodeId

Yes

The ID of the valid GRP Node.

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example retrieves the Node Reference Service of a specified Node.

Copy
GetNodeRefService
Sub
 
    MsgBox GrpClient.GetNodeRefService("0000000008")
 
End Sub

Back to top

GetNodeRefSite

The GetNodeRefSite method retrieves the Node Reference Site for a specified node.

Syntax

GetNodeRefSite(nodeId As String, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

nodeId

Yes

The ID of the valid GRP Node.

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example retrieves the Node Reference Site of a specified Node.

Copy
GetNodeRefSite
Sub
 
    MsgBox GrpClient.GetNodeRefSite("0000000008")
 
End Sub

Back to top

GetNodes

The GetNodes method retrieves the Node ID list for matching criteria.

Syntax

GetNodes(Criteria As String, OrderBy As String, NodeIdList As Variant, GrpSiteService As Variant)

Parameters

Parameter Required Description

Criteria

Yes

A set of semicolon-separated column/value parameter pairs used to filter the Nodes.  See Node Attributes for a list of possible attribute IDs by which to filter.

OrderBy

Yes

A semicolon-separated list of columns by which to order the list of returned Nodes. See Node Attributes for a list of possible attribute IDs by which to order.

NodeIdList

Yes

The Node ID list returned by this method.

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example retrieves a filtered Node list and presents it in a message box.

Copy
GetNodes
Sub
 
    Dim aryNodes
    GrpClient.GetNodes "~type=~F;~attr0=ATTR_VAL", "~cat;~appl1", aryNodes
     
    Dim i, strNodes
    For i = 0 To UBound(aryNodes)
    strNodes = strNodes & aryNodes(i) & vbCr
    Next
     
    MsgBox strNodes
 
End Sub

Back to top

GetNodeSecApp

The GetNodeSecApp method retrieves the Node Security Application for a specified Node.

Syntax

GetNodeSecApp(nodeId As String, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

nodeId

Yes

The ID of the valid GRP Node.

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example retrieves the Node Security Application of a specified Node.

Copy
GetNodeSecApp
Sub
 
    MsgBox GrpClient.GetNodeSecApp("0000000008")
 
End Sub

Back to top

GetNodeSecEvent

The GetNodeSecEvent method retrieves the Node Security Event for a specified node.

Syntax

GetNodeSecurityEvent(nodeId As String, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

nodeId

Yes

The ID of the valid GRP Node.

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example retrieves the Node Security Event of a specified node.

Copy
GetNodeSecEvent
Sub
 
    MsgBox GrpClient.GetNodeSecEvent("0000000008")
 
End Sub

Back to top

GetNodeType

The GetNodeType method retrieves the Node Type for a specified node.

Syntax

GetNodeType(nodeId As String, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

nodeId

Yes

The ID of the valid GRP Node.

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example retrieves the Node Type of a specified Node.

Copy
GetNodeType
Sub
 
    MsgBox GrpClient.GetNodeType("0000000008")
 
End Sub

Back to top

GetParents

The GetParents method retrieves the parent Node ID list for a specified node.

Syntax

GetParents(childNodeId As String, Criteria As String, OrderBy As String, ParentIdList As Variant, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

childNodeId

Yes

The ID of the Node for which to retrieve parents.

Criteria

Yes

A set of semicolon-separated column/value parameter pairs used to filter the parents.  See Node Attributes for a list of possible attribute IDs by which to filter.

OrderBy

Yes

A semicolon-separated list of columns by which to order the list of returned parents. See Node Attributes for a list of possible attribute IDs by which to order.

ParentIdList

Yes

The parent Node ID list returned by this method.

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example retrieves a filtered parent Node list for parent Node 0000000018 and presents it in a message box.

Copy
GetParents
Sub
 
    Dim aryParents
    GrpClient.GetParents "0000000018", "~type=~F;~attr0=ATTR_VAL", "~cat;~appl1", aryParents
     
    Dim i, strParents
    For i = 0 To UBound(aryParents)
    strParents = strParents & aryParents(i) & vbCr
    Next
     
    MsgBox strParents
 
End Sub

Back to top

GetReferences

The GetReferences method retrieves data for the services the GRP client references.

Syntax

GetReferences(GrpSiteService As Variant) As Integer

Parameters

Parameter Required Description

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example refreshes the connected services:

Copy
GetReferences
Sub getReferences()
 
    <NameofServiceClientObject>.GetReferences
    MsgBox "Services references retrieved"

End Sub

The following example retrieves data for referenced services and displays a referenced service in a message box.

Copy
GetReferences
Sub

    GrpClient.GetReferences()
    MsgBox GrpClient.AccessControlService 

End Sub

Back to top

HasAuxData

The HasAuxData method returns true if the specified node has auxiliary data stored.

Syntax

HasAuxData(nodeId As String, grpSiteService As Variant) As Boolean

Parameters

Parameter Required Description

nodeId

Yes

The ID of the valid GRP Node.

grpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example checks whether or not a Node has auxiliary data.

Copy
HasAuxData
Sub
 
    MsgBox GrpClient.HasAuxData("0000000008")
 
End Sub

Back to top

HasChildren

The HasChildren method returns true if the specified node has any children.

Syntax

HasChildren(nodeId As String, Criteria As String, GrpSiteService As Variant) As Boolean

Parameters

Parameter Required Description

nodeId

Yes

The ID of the valid GRP Node.

Criteria Yes A set of semicolon-separated column/value parameter pairs used to filter the children.  See Node Attributes for a list of possible attribute IDs by which to filter.

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example checks whether or not a node has children.

Copy
HasChildren
Sub
 
    MsgBox GrpClient.HasChildren("0000000008")
 
End Sub

Back to top

HasParents

The HasParents method returns true if the specified Node has any parents.

Syntax

HasParents(nodeId As String, Criteria As String, GrpSiteService As Variant) As Boolean

Parameters

Parameter Required Description

nodeId

Yes

The ID of the valid GRP Node.

Criteria Yes A set of semicolon-separated column/value parameter pairs used to filter the parents.  See Node Attributes for a list of possible attribute IDs by which to filter.

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example checks whether or not a Node has parents.

Copy
HasParents
Sub
 
    MsgBox GrpClient.HasParents("0000000008")
 
End Sub

Back to top

IsExpandable

The IsExpandable method returns true if the specified node is expandable.

Syntax

IsExpandable(nodeId As String, GrpSiteService As Variant) As Boolean

Parameters

Parameter Required Description

nodeId

Yes

The ID of the valid GRP Node.

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example checks whether or not a Node is expandable.

Copy
IsExpandable
Sub
 
    MsgBox GrpClient.IsExpandable("0000000008")
 
End Sub

Back to top

IsValidPath

The IsValidPath method returns true if the specified node path is valid.

Syntax

IsViewable(nodePath As String) As Boolean

Parameters

Parameter Required Description

nodePath

Yes

A valid Group Blob node path to the node in the form "\\SITE.SERVICE\folder1\folder2" or "\\SITE.SERVICE\folder1\file.txt".

See Group Blob Naming Rules above for information about naming rules for file names and file paths.

Remarks

This method does not check whether or not the Nodes in a path actually exist.  Rather, it ensures that the nodePath parameter is in the correct Node path format.

Example

The following example checks whether or not a Node path is valid.

Copy
IsValidPath
Sub
 
    MsgBox GrpClient.IsValidPath("\Root\Hierarchy\View\Level")
    'displays True
 
End Sub

Back to top

IsViewable

The IsViewable method returns true if the specified node is viewable.

Syntax

IsViewable(nodeId As String, GrpSiteService As Variant) As Boolean

Parameters

Parameter Required Description

nodeId

Yes

The ID of the valid GRP Node.

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example checks whether or not a Node is viewable.

Copy
IsViewable
Sub
 
    MsgBox GrpClient.IsViewable("0000000008")
 
End Sub

Back to top

LoadAdminNodesForHierarchy

The LoadAdminNodesForHierarchy method loads admin nodes from a file into the Group service.

Syntax

LoadAdminNodesForHierarchy(grpService As String, filename As String, facSourcesToReplace As String, filetype As Long)

Parameters

Parameter Required Description

grpService

Yes

The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

filename

Yes

The path to the file containing the admin Nodes to load.  This file must be a binary file, in the same format as the files generated by SaveAdminNodesForHierarchy.

facSourcesToReplace

Yes

A set of semicolon-separated parameters specifying both strings to be replaced, and the replacement strings (for example, "SOMEONE.UIS=CYGDEMO.UIS;SOMEONE.FAC=CYGDEMO.FAC").

filetype

Yes

The only supported value for this parameter is:

See Group Blob Naming Rules above for information about naming rules for file names and file paths.

Remarks

This method will only load admin Nodes into the GRP service.  To load all other Nodes, use LoadNodes.

Example

The following example loads admin Nodes from a file into the GRP service, and replaces all instances of "SOMEONE.UIS" with "CYGDEMO.UIS".

Copy
LoadAdminNodesForHierarchy
Sub
 
    Dim strNodesToReplace
    strNodesToReplace = "SOMEONE.UIS=" & GrpClient.SiteService
     
    GrpClient.LoadAdminNodesForHierarchy GrpClient.SiteService, "C:\MyAdminNodes.dat", strNodesToReplace, 1 
 
End Sub

Back to top

LoadHierarchyCache

The LoadHierarchyCache method loads a hierarchy into the cache, starting with the specified node.

Syntax

LoadHierarchyCache(nodeId As String, nMaxLevels As Long, GrpSiteService As Variant)

Parameters

Parameter Required Description

nodeId

Yes

The ID of the valid GRP Node.

nMaxLevels

Yes

The maximum number of levels in the hierarchy to load into the cache.

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example loads 5 levels of the hierarchy starting with Node 0000000008 into the cache.

Copy
LoadHierarchyCache
Sub
 
    GrpClient.LoadHierarchyCache "0000000008", 5
 
End Sub

Back to top

LoadNodes

The LoadNodes method loads nodes from a file into the Group service.

Syntax

LoadNodes(grpService As String, filename As String, facSourcesToReplace As String, filetype As Long)

Parameters

Parameter Required Description

grpService

Yes

The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

filename

Yes

The path to the file containing the Nodes to load.  This file must be a binary file, in the same format as the files generated by SaveNodes.

facSourcesToReplace

Yes

A set of semicolon-separated parameters specifying both strings to be replaced, and the replacement strings (for example, "SOMEONE.UIS=CYGDEMO.UIS;SOMEONE.FAC=CYGDEMO.FAC").

filetype

Yes

The only supported value for this parameter is:

See Group Blob Naming Rules above for information about naming rules for file names and file paths.

Example

The following example loads Nodes from a file into the GRP service, and replaces all instances of "SOMEONE.UIS" with "CYGDEMO.UIS".

Copy
LoadNodes
Sub
 
    Dim strNodesToReplace
    strNodesToReplace = "SOMEONE.UIS=" & GrpClient.SiteService
     
    GrpClient.LoadNodes GrpClient.SiteService, "C:\MyNodes.dat", strNodesToReplace, 1 
 
End Sub

Back to top

MoveGroupBlob

The MoveGroupBlob method moves a Group Blob node to a specified location.

Syntax

MoveGroupBlob(nodePath As String, newPath As String)

Parameters

Parameter Required Description

nodePath

Yes

A valid Group Blob node path to the node in the form "\\SITE.SERVICE\folder1\folder2" or "\\SITE.SERVICE\folder1\file.txt".

newPath

Yes

The new path for the Node. This must be relative to nodePath, and in the form "\folder1\folder2".

See Group Blob Naming Rules above for information about naming rules for file names and file paths.

Remarks

nodePath must specify a file. Directories cannot be moved. The method will fail and display an error if a file with the same name already exists at newPath, or if nodePath or newPath specifies an invalid path.

Example

The following example moves "Test.txt" from folder "2" to folder "3", and alerts the user that only one copy exists.

Copy
MoveGroupBlob
Sub moveBlob()
 
    GrpClient.MoveGroupBlob "\\CYGDEMO.GRP\1\2\Test.txt", "\1\3"
    MsgBox GrpClient.FileExists("\\CYGDEMO.GRP\1\2\Test.txt")  'Returns False
    MsgBox GrpClient.FileExists("\\CYGDEMO.GRP\1\3\Test.txt")  'Returns True
 
End Sub

Back to top

NodeExists

The NodeExists method returns true if the specified node exists.

Syntax

NodeExists(nodeId As String, GrpSiteService As Variant) As Boolean

Parameters

Parameter Required Description

nodeId

Yes

The ID of the valid GRP Node.

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example checks whether or not a node exists.

Copy
NodeExists
Sub
 
    MsgBox GrpClient.NodeExists("0000000008")
 
End Sub

Back to top

NodeIsADirectory

The NodeIsADirectory method returns true if the specified node is a directory and returns false if the specified node is a file.

Syntax

NodeIsADirectory(nodeID As String, grpService As String) As Boolean

Parameters

Parameter Required Description

nodeId

Yes

The ID of the valid GRP Node.

grpService

Yes

The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example checks if the Node is a directory and alerts the user.

Copy
NodeIsADirectory
Sub nodeIsDir()
 
    Dim isDir
    isDir = GrpClient.NodeIsADirectory("0000000081", GrpClient.SiteService)
    If isDir Then
        edtMessage.Text = "The node is a directory"
    Else
        edtMessage.Text = "The node is not a directory"
    End If
 
End Sub

Back to top

NodeIsAFile

The NodeIsAFile method correctly returns true if the specified node is a file and returns false if the specified node is a directory.

Syntax

NodeIsAFile(nodeID As String, grpService As String) As Boolean

Parameters

Parameter Required Description

nodeId

Yes

The ID of the valid GRP Node.

grpService

Yes

The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example checks if the node is a file and alerts the user.

Copy
NodeIsAFile
Sub nodeIsFile()
 
    Dim isFile
    isFile = GrpClient.NodeIsAFile("0000000080", GrpClient.SiteService)
    If isFile Then
        edtMessage.Text = "The node is a file"
    Else
        edtMessage.Text = "The node is not a file"
    End If
 
End Sub

Back to top

ReadAuxData

The ReadAuxData method returns a specified node’s auxiliary data.

Syntax

ReadAuxData(nodeId As String, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

nodeId

Yes

The ID of the valid GRP Node.

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example displays a node’s auxiliary data.

Copy
NodeIsAFile
Sub
 
    MsgBox GrpClient.ReadAuxData("0000000008")
 
End Sub

Back to top

ReadGroupBlob

The ReadGroupBlob method reads data from the Group Blob node.

Syntax

ReadGroupBlob(nodePath As String) As String

Parameters

Parameter Required Description

nodePath

Yes

A valid Group Blob node path to the node in the form "\\SITE.SERVICE\folder1\folder2" or "\\SITE.SERVICE\folder1\file.txt".

See Group Blob Naming Rules above for information about naming rules for file names and file paths.

Remarks

nodePath must specify a text file.

If nodePath specifies an invalid path or a directory, an empty string is returned.

This method with return the text stored inside of the file.

Example

The following example stores the contents of "File.txt" in a variable and displays it in an edit box.

Copy
ReadGroupBlob
Sub readBlob()
 
    Dim strFile
    strFile = GrpClient.ReadGroupBlob("\\CYGDEMO.GRP\MyFolder\File.txt")
    edtMessage.Text = strFile
 
End Sub

Back to top

ReadGroupBlobToFile

The ReadGroupBlobToFile method reads data from the specified Group Blob node and stores it in a specified file.

Syntax

ReadGroupBlobToFile(nodePath As String, dataPath As String)

Parameters

Parameter Required Description

nodePath

Yes

A valid Group Blob node path to the node in the form "\\SITE.SERVICE\folder1\folder2" or "\\SITE.SERVICE\folder1\file.txt".

dataPath

Yes

A valid local file path to which the data will be written.

See Group Blob Naming Rules above for information about naming rules for file names and file paths.

Remarks

nodePath and dataPath must specify text files. The file specified by DataPath will be overwritten or created once a valid directory exists.

If nodePath specifies an invalid path, an empty file will be created. If DataPath specifiies an invalid path, no file will be created and no error will be displayed.

Example

The following example saves the Blob file "File.txt" as "Test.txt".

Copy
ReadGroupBlobToFile
Sub readBlobToFile()
 
    GrpClient.ReadGroupBlobToFile "\\CYGDEMO.GRP\MyFolder\File.txt", "C:\Test.txt"
    edtMessage.Text = "C:\Test.txt has been created"
 
End Sub

Back to top

RemoveGroupBlobDir

The RemoveGroupBlobDir method removes the Group Blob node from the hierarchy if it is a directory-type node.

Syntax

RemoveGroupBlobDir(nodePath As String)

Parameters

Parameter Required Description

nodePath

Yes

A valid Group Blob node path to the node in the form "\\SITE.SERVICE\folder1\folder2" or "\\SITE.SERVICE\folder1\file.txt".

See Group Blob Naming Rules above for information about naming rules for file names and file paths.

Remarks

If nodePath specifies an invalid path, an error will be displayed. If nodePath specifies a file, the file will be deleted.

Example

The following example deletes the "MyFolder" directory from the Blob.

Copy
RemoveGroupBlobDir
Sub removeBlobDir()
 
    GrpClient.RemoveGroupBlobDir "\\CYGDEMO.GRP\MyFolder\ "
    edtMessage.Text = "MyFolder has been removed"
 
End Sub

Back to top

RemoveGroupBlobFile

The RemoveGroupBlobFile method removes the Group Blob node from the hierarchy if it is a file-type node.

Syntax

RemoveGroupBlobFile(nodePath As String)

Parameters

Parameter Required Description

nodePath

Yes

A valid Group Blob node path to the node in the form "\\SITE.SERVICE\folder1\folder2" or "\\SITE.SERVICE\folder1\file.txt".

See Group Blob Naming Rules above for information about naming rules for file names and file paths.

Remarks

If nodePath specifies an invalid path or a directory, an error will be displayed.

Example

The following example deletes "Test.txt" from the Blob.

Copy
RemoveGroupBlobFile
Sub removeBlobFile()
 
    GrpClient.RemoveGroupBlobFile "\\CYGDEMO.GRP\MyFolder\Test.txt"
    edtMessage.Text = "Test.txt has been removed"
 
End Sub

Back to top

RenameGroupBlob

The RenameGroupBlob method renames a Group Blob node folder or file.

Syntax

RenameGroupBlob(nodePath As String, newName As String)

Parameters

Parameter Required Description

nodePath

Yes

A valid Group Blob node path to the node in the form "\\SITE.SERVICE\folder1\folder2" or "\\SITE.SERVICE\folder1\file.txt".

newName

Yes

The new name for the Group Blob node.

See Group Blob Naming Rules above for information about naming rules for file names and file paths.

Remarks

If nodePath specifies an invalid path, an error will be displayed. This method will fail if a file or folder already exists with the same name as newName.

Example

The following example renames "MyFolder" to "Test" and alerts the user.

Copy
RenameGroupBlob
Sub renameBlob()
 
    GrpClient.RenameGroupBlob "\\CYGDEMO.GRP\MyFolder", "Test"
    edtMessage.Text = GrpClient.DirectoryExists("\\CYGDEMO.GRP\Test")
    'Returns  True
 
End Sub

Back to top

SaveAdminNodesForHierarchy

The SaveAdminNodesForHierarchy method saves admin Nodes in a specified hierarchy to a file.

Syntax

SaveAdminNodesForHierarchy(grpService As String, hierarchy As String, filename As String, filetype As Long)

Parameters

Parameter Required Description

grpService

Yes

The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

hierarchy

Yes

The description of a Navigation Root Node.  This Node must be of type Navigation Root (~V) and in the Root Group (R) category.

filename

Yes

The name of the file (including the path) to which to save the admin Nodes.

filetype

Yes

The only supported value for this parameter is:

See Group Blob Naming Rules above for information about naming rules for file names and file paths.

Remarks

This method will only save admin Nodes.  To save all other Nodes, use SaveNodes.

Example

The following example saves admin Nodes to a file.

Copy
SaveAdminNodesForHierarchy
Sub
 
    GrpClient.SaveAdminNodesForHierarchy "CYGDEMO.GRP", "Navigation Hierarchy", _
    "C:\MyAdminNodes.dat", 1
 
End Sub

Back to top

SaveNodes

The SaveNodes method saves a Node and all of its children to a file.

Syntax

SaveNodes(grpService As String, nodeID As String, filename As String, filetype As Long)

Parameters

Parameter Required Description

grpService

Yes

The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

nodeId

Yes

The ID of the valid GRP Node.

filename

Yes

The name of the file (including the path) to which to save the Nodes.

filetype

Yes

The only supported value for this parameter is:

See Group Blob Naming Rules above for information about naming rules for file names and file paths.

Example

The following example saves Nodes to a file.

Copy
SaveNodes
Sub
 
    GrpClient.SaveNodes "CYGDEMO.GRP", "0000000008", "C:\MyNodes.dat", 1
 
End Sub

Back to top

UpdateNodeAttribute

The UpdateNodeAttribute method updates a specified Node’s attribute.

Syntax

UpdateNodeAttribute(nodeId As String, attrId As String, attrValue As String, GrpSiteService As Variant)

Parameters

Parameter Required Description

nodeId

Yes

The ID of the valid GRP Node.

attrId

Yes

The ID of the attribute to update.

attrValue

Yes

The new value for the attribute.

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example updates a Node’s attribute.

Copy
UpdateNodeAttribute
Sub
 
    GrpClient.UpdateNodeAttribute "0000000008", "~attr0", "NEW_VALUE"
 
End Sub

Back to top

WriteAuxData

The WriteAuxData method writes auxiliary data to the specified group node.

Syntax

WriteAuxData(nodeID As String, textData As String, GrpSiteService As Variant)

Parameters

Parameter Required Description

nodeId

Yes

The ID of the valid GRP Node.

textData

Yes

The auxiliary data to write to the Node.

GrpSiteService

No

Optional. The GRP Site.Service to which to connect. If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example writes auxiliary data to a node.

Copy
WriteAuxData
Sub
 
    GrpClient.WriteAuxData "0000000008", "Some auxiliary data"
 
End Sub

Back to top

WriteGroupBlob

The WriteGroupBlob method writes data to the Group Blob node in the path.

Syntax

WriteGroupBlob(nodePath As String, nodeData As String, CreateDirectory As Boolean)

Parameters

Parameter Required Description

nodePath

Yes

A valid Group Blob node path to the node in the form "\\SITE.SERVICE\folder1\folder2" or "\\SITE.SERVICE\folder1\file.txt".

nodeData

Yes

The data to be written.

CreateDirectory

Yes

If this parameter is set to True, the directory specified by nodePath will be created if it does not already exist.

See Group Blob Naming Rules above for information about naming rules for file names and file paths.

Remarks

nodePath must specify a text file. If nodePath specifies a directory, or if Create is set to False and nodePath specifies a non-existent directory, an error will be displayed.

Example

The following example writes a new file to the Blob containing the text "Hello World!"

Copy
WriteGroupBlob
Sub writeBlob()
 
    GrpClient.WriteGroupBlob "\\CYGDEMO.GRP\MyFolder\File.txt", "Hello World!", True
 
End Sub

Back to top

WriteGroupBlobFromFile

The WriteGroupBlobFromFile method writes data from a file to the Group Blob node at the specified path.

Syntax

WriteGroupBlobFromFile(nodePath As String, dataPath As String, CreateDirectory As Boolean)

Parameters

Parameter Required Description

nodePath

Yes

A valid Group Blob node path to the node in the form "\\SITE.SERVICE\folder1\folder2" or "\\SITE.SERVICE\folder1\file.txt".

dataPath

Yes

The local file path to the data to be written.

CreateDirectory

Yes

If this parameter is set to True, the directory specified by nodePath will be created if it does not already exist.

See Group Blob Naming Rules above for information about naming rules for file names and file paths.

Remarks

nodePath and DataPath must specify text files. Binary data is not supported.

If nodePath specifies a directory, or if Create is set to False and nodePath specifies a non-existent directory, an error will be displayed.

If DataPath specifies an invalid path, an empty text document will be created at the path specified by nodePath.

Example

The following example writes the data from local file "New.txt" to the Blob path as "Hi.txt".

Copy
WriteGroupBlobFromFile
Sub writeBlobFile()
 
    GrpClient.WriteGroupBlobFromFile "\\CYGDEMO.GRP\Folder\Hi.txt", "C:\New.txt", True
    edtMessage.Text = "New.txt has been added to the blob"
 
End Sub

Back to top